﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Iudicium.Configuracion.CRN
{

    /// <summary>
    /// Descripción breve de VersionCRN
    /// </summary>
    public class VersionCRN
    {
        public VersionCRN()
        {
            
        }

        public static Version GetVersion()
        {
            VersionDSTableAdapters.VersionTableAdapter adapter = new VersionDSTableAdapters.VersionTableAdapter();

            VersionDS.VersionDataTable tabla = adapter.GetVersion();

            if (tabla == null || tabla.Count <= 0)
            {
                throw new Exception("El SQL se ejecuto correctamente pero devolvio un conjunto de datos vacio.");
            }

            VersionDS.VersionRow row = tabla[0];
            Version objVersion = new Version(row.versionMayor, row.versionMenor, row.release);

            return objVersion;
        }
    }
}